/*
 * p4766.cpp
 *
 *  Created on: 2013-10-29
 *      Author: zy
 */
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;
#define SZ(x) ((int)x.size())
#define SQR(v) ((v)*(v))
const double eps = 1e-8;
double my_acos(double d)
{
	return acos(d > 1 ? 1 : d < -1 ? -1 : d);
}
double my_sqrt(double d)
{
	return sqrt(max(d, 0.0));
}
int sig(double a)
{
	return (a > eps) - (a < -eps);
}
struct Point
{
	double x, y;
	Point(double x, double y) :
		x(x), y(y)
	{
	}
	Point()
	{
	}
	bool operator ==(const Point &a) const
	{
		return sig(x - a.x) == 0 && sig(y - a.y) == 0;
	}
	Point friend operator +(Point a, Point b)
	{
		return Point(a.x + b.x, a.y + b.y);
	}
	Point friend operator -(Point a, Point b)
	{
		return Point(a.x - b.x, a.y - b.y);
	}
	Point friend operator *(Point a, double k)
	{
		return Point(a.x * k, a.y * k);
	}
	Point resize(double a)
	{
		a /= my_sqrt(SQR(x) + SQR(y));
		return Point(x * a, y * a);
	}
	Point left90()
	{
		return Point(-y, x);
	}
	Point right90()
	{
		return Point(y, -x);
	}
	void read()
	{
		scanf("%lf%lf", &x, &y);
	}
};
double dis2(Point a, Point b)
{
	return SQR(a.x-b.x) + SQR(a.y-b.y);
}
double dis(Point a, Point b)
{
	return my_sqrt(SQR(a.x-b.x) + SQR(a.y-b.y));
}
double cross(Point o, Point a, Point b)
{
	return (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x);
}
double dot(Point o, Point a, Point b)
{
	return (a.x - o.x) * (b.x - o.x) + (a.y - o.y) * (b.y - o.y);
}
struct Circle
{
	Point c;
	double r;
	Circle(Point c, double r) :
		c(c), r(r)
	{
	}
	Circle()
	{
	}
	bool friend operator ==(Circle a, Circle b)
	{
		return sig(a.r - b.r) == 0 && a.c == b.c;
	}
	bool in(Circle a)
	{
		return sig(r + dis(c, a.c) - a.r) <= 0;
	}

};

double cal_angle(Circle c, Point a, Point b)
{
	double k = dot(c.c, a, b) / SQR(c.r);
	return my_acos(k);
}
double cal_area(Circle c, Point a, Point b)
{
	return SQR(c.r) * cal_angle(c, a, b) / 2 - cross(c.c, a, b) / 2;
}

Point mid;
bool cmp(Point a, Point b)
{
	return atan2(a.y - mid.y, a.x - mid.x) < atan2(b.y - mid.y, b.x - mid.x);
}
bool circles_intersection(Circle a, Circle b, Point &c1, Point &c2)
{
	double dd = dis(a.c, b.c);
	if (sig(dd - (a.r + b.r)) > 0)
		return false;
	double l = (dd + (SQR(a.r) - SQR(b.r)) / dd) / 2;
	double h = my_sqrt(SQR(a.r) - SQR(l));
	c1 = a.c + (b.c - a.c).resize(l) + (b.c - a.c).left90().resize(h);
	c2 = a.c + (b.c - a.c).resize(l) + (b.c - a.c).right90().resize(h);
	return true;

}
bool cover1(Circle c, Point a, Point b, vector<Circle> &cir)
{
	Point p = c.c + ((a + b) * 0.5 - c.c).resize(c.r);
	for (vector<Circle>::iterator it = cir.begin(); it != cir.end(); it++)
		if (sig(dis2(p, it->c) - SQR(it->r)) > 0)
			return false;
	return true;
}
double d;
bool circle_inter(vector<Circle> &cs)
{
	int zx[] =
	{ 0, 1, 0, -1 };
	int zy[] =
	{ 1, 0, -1, 0 };
	vector<Circle> cir;
	for (int i = 0; i < SZ(cs); i++)
	{
		if (sig(cs[i].r) == 0)
			goto out;
		for (int j = i + 1; j < SZ(cs); j++)
			if (cs[i] == cs[j])
				goto out;
		for (int j = 0; j < SZ(cs); j++)
			if (!(cs[i] == cs[j]) && cs[j].in(cs[i]))
				goto out;
		cir.push_back(cs[i]);
		out: ;
	}
	vector<vector<Point> > poc(SZ(cir));
	for (int i = 0; i < SZ(cir); i++)
	{
		for (int z = 0; z < 4; z++)
		{
			poc[i].push_back(cir[i].c + Point(zx[z], zy[z]).resize(cir[i].r));
		}
	}
	vector<Point> all;
	for (int i = 0; i < SZ(cir); i++)
		for (int j = i + 1; j < SZ(cir); j++)
		{
			Point a, b;
			if (circles_intersection(cir[i], cir[j], a, b))
			{
				poc[i].push_back(a);
				poc[i].push_back(b);
				poc[j].push_back(a);
				poc[j].push_back(b);
				all.push_back(a);
				all.push_back(b);
			}
			else
				return 0;
		}
	for (int i = 0; i < SZ(cir); i++)
	{
		mid = (cir[i].c);
		sort(poc[i].begin(), poc[i].end(), cmp);
		poc[i].erase(unique(poc[i].begin(), poc[i].end()), poc[i].end());
	}
	double ans = 0;
	bool ok = false;
	for (int i = 0; i < SZ(cir); i++)
	{
		poc[i].push_back(poc[i][0]);
		for (int j = 0; j < SZ(poc[i]) - 1; j++)
		{
			Point a = poc[i][j];
			Point b = poc[i][j + 1];
			if (cover1(cir[i], a, b, cir))
			{
				ans += cross(Point(0, 0), a, b) / 2;
				ans += cal_area(cir[i], a, b);
				ok = true;
			}
		}
	}
	return ok;
}
double pointToCircle(Point p, Circle c)
{
	double len = dis(p, c.c);
	return len > c. r ? len - c.r : len;
}
vector<Circle> vec;
vector<Point> p;
int n;
bool check(double tt)
{
	vec[vec.size() - 1].r = tt;
	return circle_inter(vec);
}
int main()
{
	double x, y;
	while (scanf("%lf%lf%lf", &x, &y, &d) != EOF)
	{
		Point st = Point(x, y);
		p.clear();
		vec.clear();
		//p.push_back(st);
		scanf("%d", &n);
		Point tem;
		while (n--)
		{
			tem.read();
			p.push_back(tem);
		}
		for (int i = 0; i < p.size(); i++)
			vec.push_back(Circle(p[i], d));
		if (!circle_inter(vec))
		{
			puts("X");
			continue;
		}
		vec.push_back(Circle(st, d));
		double l = 0, r = 2000000;
		while (r - l > 1e-3)
		{
			double tt = (l + r) / 2;
			if (check(tt))
				r = tt;
			else
				l = tt;
		}

		printf("%0.2lf\n", l);

	}
	return 0;
}
